#ifndef __CAFF_H__
#define __CAFF_H__
#define CLIENT_MAX		10*1024
#define CMDBUF_MAX		1024
#define RETBUF_MAX		1024
#define CMD_TOKEN		' '	
#define CMD_TOKEN_MAX	5	
#define CMD_LINE_MAX	3

#define CMD_BACK_END	"END\r\n"
#define FHEAD			"CaFfUuId\r\n"
#define FHEADLEN		10
#define LINELEN_MAX		20

typedef unsigned long uuidtype; 
#define UUIDLEN			sizeof(uuidtype)

typedef struct caffClient {
	int fd;
	char cmdbuf[CMDBUF_MAX];
	char retbuf[RETBUF_MAX];
} caffClient;

struct caffServer{
	int port;
	int fd;
	caffClient *clients[CLIENT_MAX];
	char *pidfile;
	char *key;
	bool daemonize;
	uuidtype *uuidnum;
	char *uuidpath;
	aeEventLoop *el;
};

static struct caffServer server;

#endif
